import { master } from '@nodejs/express'
import { onDestory, registeOnDestoryHook } from '@core/types'

import { config } from 'dotenv'
import { existsSync } from 'fs';
import { cpus, homedir } from 'os'
import { join } from 'path';
const root = homedir()
const envFile = join(root, 'sker/.env')

registeOnDestoryHook()
if (existsSync(envFile)) {
    config({
        path: join(root, 'sker/.env')
    });
}
master(cpus().length);